package com.ykdl.member.kid.adapters;

import java.io.Serializable;
import java.text.DecimalFormat;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ykdl.member.kid.beans.OrderBean;

import net.wxxr.http.interfaces.IJsonParser;

public class DebateBean implements Serializable, IJsonParser{

	/**
	 * "debate": {
                    "debate_begin_time": 1427188230,
                    "debate_end_time": 1431889500,
                    "debate_price": 2,
                    "debate_info": "折扣方式"
                },
	 */
	private static final long serialVersionUID = 1L;
	private String debate_price;
	public String getDebate_price() {
		double price =Double.parseDouble(debate_price);
		DecimalFormat decimalFormat=new DecimalFormat("##0.00");//构造方法的字符格式这里如果小数不足2位,会以0补足.
		String p=decimalFormat.format(price);//format 返回的是字符串
		return p;
	}
	@Override
	public IJsonParser parse(String json) throws Exception {
		// TODO Auto-generated method stub
		Gson   gson = null;
		if(null != json){
			GsonBuilder b = new GsonBuilder();
			gson  = b.create();
			return gson.fromJson(json, DebateBean.class);
		}
		return null;
	}

}
